using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using WMEncoderLib;

namespace WMRecorder
{
  public partial class OptionsPanel : UserControl
  {

    public string RecordSource
    {
      get
      {
        return cbSources.Text;
      }
      set
      {
        cbSources.Text = value;
      }
    }

    public OptionsPanel()
    {
      InitializeComponent();
    }

    private void OptionsPanel_Load(object sender, EventArgs e)
    {
      try
      {
        WMEncoderLib.WMEncoder Encoder = new WMEncoder();
        IWMEncSourcePluginInfoManager SrcPlugMgr = Encoder.SourcePluginInfoManager;
        IWMEncDeviceControlPluginInfoManager DCPlugMgr = Encoder.DeviceControlPluginInfoManager;
        IWMEncPluginInfo PlugInfo;
        for (int i = 0; i < SrcPlugMgr.Count; i++)
        {
          PlugInfo = SrcPlugMgr.Item(i);
          if (PlugInfo.SchemeType == "DEVICE" && PlugInfo.Resources == true)
          {
            for (int j = 0; j < PlugInfo.Count; j++)
            {
              if (PlugInfo.MediaType == WMENC_SOURCE_TYPE.WMENC_AUDIO) cbSources.Items.Add(PlugInfo.Item(j));
            }
          }
        }
      }
      catch
      {
      }
    }
  }
}
